﻿using System.Threading.Tasks;
using Jinjia.Approve.Model.Input.JJFlow;
using Jinjia.Approve.Model.VM.JJFlow;
using Jinjia.Core.BaseInfrastructure.BaseModel.BaseModel;
using Jinjia.Core.BaseInfrastructure.StorageModel.Model;

namespace Jinjia.Approve.IService.JJFlow
{
    public interface IJJFlowTemplateService
    {
        /// <summary>
        /// 根据模块ID获取 template_id
        /// </summary>
        /// <param name="modular_key"></param>
        /// <returns></returns>
        Task<int> GetTemplateID(string modular_key);

        /// <summary>
        /// 是否存在审批流模板
        /// </summary>
        /// <param name="template_id"></param>
        /// <returns>true存在; false不存在</returns>
        Task<bool> IsExistTemplate(int template_id);

        Task<JjFlowTemplateVM> GetTemplateById(int template_id);

        /// <summary>
        /// 获取工作流模板列表
        /// </summary>
        /// <param name="searchCondition"></param>
        /// <returns></returns>
        Task<PageListSearchResultVM<JJTemplateViewModel>> GetTemplatePageList(JJTemplateSearchCondition searchCondition);

        /// <summary>
        /// 根据id获取工作流模板信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<JJTemplateSignleViewModel> GetTemplateDetail(int id);

        /// <summary>
        /// 删除工作流模板
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteTemplate(int id);

        /// <summary>
        /// 新增编辑
        /// 对应业务类型的清理  以及 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResponseResult<string>> SaveTemplate(JJTemplateEditViewModel model);
    }
}